package com.qinggeng.project.system.mapper;

import com.qinggeng.project.system.domain.GoodsPercent;

import java.math.BigDecimal;
import java.util.List;

public interface GoodsPercentMapper {

    int insertGoodsPercent(GoodsPercent goodsPercent);

    /**
     * 批量删除
     * @param id
     * @return
     */
    int deleteGoodsPercentByIds(Long[] id);

    int updateGoodsPercent(GoodsPercent goodsPercent);

    /**
     * 根据商品ID查询主类百分比
     * @param goodsId
     * @return
     */
    GoodsPercent selectGoodsPercentByGoodsId(Long goodsId);

    /**
     * 查询商品百分比列表
     * @param goodsPercent
     * @return
     */
    List<GoodsPercent> selectGoodsPercentList(GoodsPercent goodsPercent);

    GoodsPercent getGoodsPercentById(Long id);

    /**
     * 根据商品分类计算订单抽奖次数
     * @param ordersId
     * @param classifyId
     * @param drawPrice
     * @return
     */
    BigDecimal getDrawTimes(Long ordersId,Long classifyId,BigDecimal drawPrice);

}
